package samsung.sds.system.security.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import samsung.sds.system.security.dao.SysRoleToResMapper;
import samsung.sds.system.security.service.SecurityManagerService;
import samsung.sds.userManagement.model.UserEntity;
import samsung.sds.userManagement.service.UserManagementService;

@Service("securityManagerServiceImpl")
public class SecurityManagerServiceImpl implements SecurityManagerService {

 
	@Autowired
	private UserManagementService userManagementServiceImpl;
	
	@Autowired
	private SysRoleToResMapper rTrMapper;
	
	public UserEntity getSystemUser(String username) {
		UserEntity user = new UserEntity();
		user.setUsername(username);
		return userManagementServiceImpl.findUniqueByProperty(user);
		
	}
	
	public List<String> getRoleNameList(String username) {
		return userManagementServiceImpl.queryUserRole(username);
	}
	
	public List<Map<String,String>> getRoleResList(){
		return rTrMapper.getRoleResList();
	}

	public void updateLastLoginTime(String userName) {		
		System.err.println("============TODO: print login time after login ");		
	}
	
	

}
